package org.ushio.nchu_22201408.mapper;

import org.apache.ibatis.annotations.*;
import org.ushio.common_module.entity.Bill;
import java.util.List;

@Mapper
public interface BillMapper {

    @Results({
            @Result(property = "billId", column = "Bill_ID"),
            @Result(property = "paymentMethod", column = "Payment_Method"),
            @Result(property = "paymentAmount", column = "Payment_Amount"),
            @Result(property = "paymentDate", column = "Payment_Date"),
            @Result(property = "paymentReason", column = "Payment_Reason"),
            @Result(property = "phoneNumber", column = "Phone_Number")
    })
    @Select("SELECT * FROM bill WHERE Phone_Number = #{phoneNumber}")
    List<Bill> findAllBillsByPhoneNumber(@Param("phoneNumber") String phoneNumber);
    @Insert("INSERT INTO bill (Payment_Method, Payment_Amount, Payment_Date, Payment_Reason, Phone_Number) VALUES (#{paymentMethod}, #{paymentAmount}, #{paymentDate}, #{paymentReason}, #{phoneNumber})")
    void insertBill(Bill bill);
}